home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Texteditors / Textra116 / Textra Installer < prev    next >
Text File  |  1996-09-26  |  8KB  |  308 lines

  1. ; Script to install Textra 1.16 11-Nov-94  (for CBM Installer 1.24)
  2.  
  3. ; get the OS version number (34=1.3, 36=2.0, 37=2.1, etc)
  4. (set vernum (getversion))
  5. (set vernum (/ vernum 65536))
  6.  
  7. (set filesOk 0)
  8.  
  9. (if (exists "scripts" (noreq))
  10.  (if (exists "scripts/JForth_Scripts" (noreq))
  11.   (if (exists "scripts/C_Scripts" (noreq))
  12.    (if (exists "scripts/HSPascal_Scripts" (noreq))
  13.     (if (exists "scripts/SASC_Scripts" (noreq))
  14.      (if (exists "docs" (noreq))
  15.       (if (exists "Textra" (noreq))
  16.        (if (exists "Textra.info" (noreq))
  17.         (if (exists "Fonts" (noreq))
  18.             (set filesOk 1)
  19. )))))))))
  20.  
  21. (if (= filesOk 0)
  22.     (exit "\n\nSorry, the Textra Installer cannot function as some of the required files or directories are missing.")
  23. )
  24.  
  25. (set AppDirName
  26.     (askdir
  27.         (prompt "Please choose the drawer in which the Textra executable (and its icon) should be installed...")
  28.         (help (cat "You may run Textra from anywhere.  It does not need any specific assigns.\n\n" @askdir-help))
  29.         (default "Work:")
  30. ;        (newpath)
  31.     )
  32. )
  33. (set @default-dest AppDirName)
  34.  
  35.  
  36. (if (= (getversion "libs:rexxsyslib.library") 0)
  37.     (
  38.         (if (askbool
  39.                 (prompt "\nARexx does not seem to be installed on your system.\n\nDo you want to install the Textra-ARexx scripts anyway?")
  40.                 (help "After you install ARexx, Textra will expect these files to reside in whatever drawer you assign as \"REXX:\"...")
  41.             )
  42.         )
  43.         (set usesARexx 1)
  44.         (set usesARexx 0)
  45.     )
  46.         (set usesARexx 1)
  47. )    
  48.  
  49. (if (= usesARexx 1)
  50.     (if (exists "rexx:" (noreq))
  51.         (set RexxDirName "rexx:")
  52.         (set RexxDirName
  53.             (askdir
  54.                 (prompt "Please choose the drawer in which the Textra-Arexx scripts should be installed \(normally REXX: but you do not have it assigned\)...")
  55.                 (help @askdir-help)
  56.                 (default "Work:TextraScripts")
  57.                 (newpath)
  58.             )
  59.         )
  60.     )
  61. )
  62.  
  63. (if (askbool
  64.         (prompt "\nDo you want to copy the Textra documentation to your hard disk?\n\nIt is several files totaling around 140k and is very detailed and complete.")
  65.         (help "\nThe documentation covers Textra as an editor, how to use the provided Arexx scripts (also writing your own), complete version history, much more.  Many files have MARKs defined for them.\n\nHighly recommended for beginners.")
  66.     )
  67.     (
  68.         (set DocsDirName
  69.             (askdir
  70.                 (prompt "Please choose the drawer in which the Textra documentation should be installed...")
  71.                 (help @askdir-help)
  72.                 (default "Work:TextraDocs")
  73.                 (newpath)
  74.             )
  75.         )
  76.         (set usesDocs 1)
  77.     )
  78.     (
  79.         (set usesDocs 0)
  80.     )
  81. )
  82.  
  83. (set LangOptions (askoptions
  84.         (prompt "Programmers...\n\nThe Textra package includes a few ARexx scripts that are language-specific.  That is, there are different sets for different languages.\n\nCheck any languages that you program in...")
  85.         (help @askoptions-help)
  86.         (choices "JForth Professional 3.x" "HS/Pascal" "C language")
  87.         (default 0)
  88.     )
  89. )
  90.  
  91. (if (BITAND LangOptions 1)
  92.     (set usesJForth 1)
  93.     (set usesJForth 0)
  94. )
  95. (if (BITAND LangOptions 2)
  96.     (set usesHSPascal 1)
  97.     (set usesHSPascal 0)
  98. )
  99. (if (BITAND LangOptions 4)
  100.     (
  101.         (set usesC 1)
  102.         (if (askbool
  103.                 (prompt "\n\nDo you use SAS/C?")
  104.                 (help "\nIn addition to general-use C scripts, the package includes some specific interface scripts to fully integrate Textra with the SAS/C compiler!")
  105.             )
  106.             (set usesSASC 1)
  107.             (set usesSASC 0)
  108.         )
  109.     )
  110.     (
  111.         (set usesC 0)
  112.         (set usesSASC 0)
  113.     )
  114. )
  115.  
  116. (set activateSASC 0)
  117. (if (= usesSASC 1)
  118.     (if (askbool
  119.             (prompt "\nYou can use Textra as a replacement for 'SE' (the SAS-provided editor).\n\nThe Textra package contains a configuration file (SCMSG) which informs SAS/C to automatically use Textra.\n\n Do you want to install it now?")
  120.             (help "\nAnwering 'Yes' activates Textra as the default SAS/C editor.  The next time you launch SAS/C, it will use Textra.\n\nAnswering 'No' causes no SAS/C configuration changes to occur.")
  121.         )
  122.         (set activateSASC 1)
  123.     )
  124. )
  125.  
  126. (set promptStr ("Operations to perform:\n----------------------\n\nCopy Textra and icon to %s\n\nCopy Textra.font to fonts:" AppDirName))
  127. (if (= usesDocs 1)
  128.     (set promptStr ("%s\n\nCopy the Textra Docs to %s" promptStr DocsDirName))
  129. )
  130.  
  131. (if (= usesARexx 1)
  132.     (set usesARexxStr ("\n\nCopy the Textra-ARexx scripts to %s" RexxDirName))
  133.     (set usesARexxStr "")
  134. )
  135. (if (OR (OR (= usesC 1) (= usesJForth 1)) (= usesHSPascal 1))
  136.     (
  137.         (set inclStr "\nincluding support for: ")
  138.         (if (= usesC 1)
  139.             (if (= usesSASC 1)
  140.                 (set inclStr (cat inclStr "SAS/C"))
  141.                 (set inclStr (cat inclStr "C"))
  142.             )
  143.         )
  144.         (if (= usesJForth 1)
  145.             (
  146.                 (if (= usesC 1)
  147.                     (set inclStr (cat inclStr ", "))
  148.                 )
  149.                 (set inclStr (cat inclStr "JForth"))
  150.             )
  151.         )
  152.         (if (= usesHSPascal 1)
  153.             (
  154.                 (if (OR (= usesC 1) (= usesJForth 1))
  155.                     (set inclStr (cat inclStr ", "))
  156.                 )
  157.                 (set inclStr (cat inclStr "HS/Pascal"))
  158.             )
  159.         )
  160.     )
  161.     (set inclStr "")
  162. )
  163.  
  164. (if (= usesSASC 1)
  165.     (set usesSASCStr "\n\nInstall Textra as default SAS/C editor")
  166.     (set usesSASCStr "")
  167. )
  168. (message (cat promptStr usesARexxStr inclStr usesSASCStr))
  169.  
  170. (copyfiles
  171.     (prompt "Copying Textra")
  172.     (help @copyfiles-help)
  173.     (source "Textra")
  174.     (dest AppDirName)
  175.     (infos)
  176. )
  177.  
  178. (copyfiles
  179.     (prompt "Copying Textra.font")
  180.     (help @copyfiles-help)
  181.     (source "Fonts")
  182.     (pattern "#?")
  183.     (dest "fonts:")
  184. )
  185. (if (exists "sys:system/fixfonts" (noreq))
  186.     (run "sys:system/fixfonts")
  187. )
  188.  
  189. (if (= usesARexx 1)
  190.     (
  191.         (copyfiles
  192.             (prompt "Copying General Textra-ARexx Scripts")
  193.             (help @copyfiles-help)
  194.             (source "scripts")
  195.             (pattern "#?.textra")
  196.             (files)
  197.             (dest RexxDirName)
  198.         )
  199.         (if (= usesC 1)
  200.             (copyfiles
  201.                 (prompt "Copying General \"C\" Textra-ARexx Scripts")
  202.                 (help @copyfiles-help)
  203.                 (source "scripts/C_scripts")
  204.                 (pattern "#?.textra")
  205.                 (files)
  206.                 (dest RexxDirName)
  207.             )
  208.         )
  209.         (if (= usesSASC 1)
  210.             (copyfiles
  211.                 (prompt "Copying Textra-ARexx Scripts for SAS/C")
  212.                 (help @copyfiles-help)
  213.                 (source "scripts/SASC_scripts")
  214.                 (pattern "#?.textra")
  215.                 (files)
  216.                 (dest RexxDirName)
  217.             )
  218.             (if (= activateSASC 1)
  219.                 (
  220.                     (if (= vernum 34)
  221.                         (
  222.                             (if (exists "sc:env/SCMSG" (noreq))
  223.                                 (rename "sc:env/SCMSG" "sc:env/SCMSG.preTextra")
  224.                             )
  225.                             (textfile
  226.                                 (include "scripts/SASC_scripts/4.installer.use")
  227.                                 (append ("EDITCOMMAND \"%s\" %%f" (tackon AppDirName "Textra")))
  228.                                 (dest "sc:env/SCMSG")
  229.                             )
  230.                             (copyfiles
  231.                                 (source "sc:env/SCMSG")
  232.                                 (dest "env:sc/SCMSG")
  233.                             )
  234.                         )
  235.                         (
  236.                             (if (exists "envarc:sc/SCMSG" (noreq))
  237.                                 (rename "envarc:sc/SCMSG" "envarc:sc/SCMSG.preTextra")
  238.                             )
  239.                             (textfile
  240.                                 (include "scripts/SASC_scripts/4.installer.use")                      
  241.                                 (append ("EDITCOMMAND \"%s\" %%f" (tackon AppDirName "Textra")))      
  242.                                 (dest "envarc:sc/SCMSG")
  243.                             )
  244.                             (copyfiles
  245.                                 (source "envarc:sc/SCMSG")
  246.                                 (dest "env:sc/SCMSG")
  247.                             )
  248.                         )
  249.                     )
  250.                 )
  251.             )
  252.         )
  253.         (if (= usesJForth 1)
  254.             (copyfiles
  255.                 (prompt "Copying Textra-ARexx Scripts for JForth")
  256.                 (help @copyfiles-help)
  257.                 (source "scripts/JForth_scripts")
  258.                 (pattern "#?.textra")
  259.                 (files)
  260.                 (dest RexxDirName)
  261.             )
  262.         )
  263.         (if (= usesHSPascal 1)
  264.             (copyfiles
  265.                 (prompt "Copying Textra-ARexx Scripts for HS/Pascal")
  266.                 (help @copyfiles-help)
  267.                 (source "scripts/HSPascal_scripts")
  268.                 (pattern "#?.textra")
  269.                 (files)
  270.                 (dest RexxDirName)
  271.             )
  272.         )
  273.     )
  274. )
  275.  
  276. (if (= usesDocs 1)
  277.     (
  278.         (copyfiles
  279.             (prompt "Copying Docs")
  280.             (help @copyfiles-help)
  281.             (source "Docs")
  282.             (pattern "#?")
  283.             (dest DocsDirName)
  284.             (infos)
  285.         )
  286.         (copyfiles
  287.             (prompt "Copying Docs")
  288.             (help @copyfiles-help)
  289.             (source "ReadMe")
  290.             (dest DocsDirName)
  291.             (infos)
  292.         )
  293.     )
  294. )
  295.  
  296. (set exitStr "")
  297.  
  298. (if (= usesDocs 1)
  299.     (set exitStr (cat exitStr ("Documentation in your \"%s\" drawer.\n\n" DocsDirName)))
  300. )
  301.  
  302. (if (= usesARexx 1)
  303.     (set exitStr (cat exitStr ("ARexx scripts in your \"%s\" drawer.\n\n" RexxDirName)))
  304. )
  305.  
  306. (exit exitStr)
  307.  
  308.